package cn.bjxy.shishaolong.request_answer.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 问答收藏表
 * </p>
 *
 * @author 时少龙
 * @since 2019-04-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_collect")
public class Collect implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "tid", type = IdType.AUTO)
    private Integer tid;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 问题或者答案的id
     */
    @TableField("req_ans_id")
    private Integer reqAnsId;

    /**
     * 问答类别：1.提问  2.回答
     */
    @TableField("req_ans_type")
    private Integer reqAnsType;

    /**
     * 创建时间
     */
    @TableField("created_at")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    /**
     * 修改时间
     */
    @TableField("updated_at")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;

    /**
     * 删除时间
     */
    @TableField("deleted_at")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deletedAt;

    //***********************   查询字段  ************************//
    /**
     * 问题标题
     */
    @TableField(exist = false)
    private String title;

    /**
     * 问题id
     */
    @TableField(exist = false)
    private Integer requestId;

    /**
     * 问题和回答内容
     */
    @TableField(exist = false)
    private String content;
}
